#include <iostream>
using std::cout;
using std::endl;

class Complex
{
public:
    Complex(int real,int image)
    : _real(real)
    , _image(image)
    {}

    void print() const{
        cout << _real;
        if(_image > 0){
           cout << " + " << _image << "i";
        }else if(_image < 0){
            cout << " - " << -1 * _image << "i";
        }
        cout << endl;
    }

    Complex & operator+=(const Complex & rhs){
        _real += rhs._real;
        _image += rhs._image;
        return *this;
    }

    Complex & operator-=(const Complex & rhs){
        _real -= rhs._real;
        _image -= rhs._image;
        return *this;
    }

    Complex & operator++(){
        ++_real;
        ++_image;
        return *this;
    }

    Complex operator++(int){
        Complex temp(*this);
        ++_real;
        ++_image;
        return temp;
    }

    Complex & operator--(){
        --_real;
        --_image;
        return *this;
    }

    Complex operator--(int){
        Complex temp(*this);
        --_real;
        --_image;
        return temp;
    }

    friend Complex operator+(const Complex & c1,const Complex & c2);
    friend Complex operator-(const Complex & c1,const Complex & c2);
private:
    int _real;
    int _image;
};

Complex operator+(const Complex & c1,const Complex & c2)
{
    return Complex(c1._real + c2._real,
                   c1._image + c2._image);
}

Complex operator-(const Complex & c1,const Complex & c2)
{
    return Complex(c1._real - c2._real,
                   c1._image - c2._image);
}

void test0(){
    Complex cx1(1,2);
    
}



int main(void){
    test0();
    return 0;
}
